Introduction

In this lesson, you will recap what you have learned about version control in prior courses. Specifically, you will learn about Git, GitHub and how to use both when managing previous versions of your application.

Scenario

Generally, a software product is developed in collaboration with a group of developers, each of whom is responsible for certain functionalities of the product. And everyone modifies the source code accordingly. However, suppose some change in the code results in a particular bug in the product. In such a case, there must be a way to track the cause of the problem and restore the state of the product to its previous working position.

There are two types of version control options: centralized and distributed. Centralized version control means versions are saved in the remote repository, whereas distributed version control can be saved in the remote repository as well as local repositories of local machines.

You can learn more about systems of version control and tools from the video Systems of version control and tools in Module 1, Lesson 2 of the Version Control course.

Git

Git is a popular distributed version control system (DVCS). It's free and the open-source software is designed to manage all source code history. You can keep a history of commits, revert to previous versions and share code.

You can go into further detail on how to work with Git by revisiting the lesson Working with Git in the Version Control course.

Following this, you can download and install Git on your machine.

As an example of using Git to commit files, follow these steps:

  1. Open the Git terminal on your machine and initialize a local repository for the Little Lemon project with the git init command.

  2. Next, add the project files to the folder and check the status.

  3. Now add the files to the staging area of the repository.

  4. You need to configure the repository with relevant credentials before committing to the local repository.

  5. Then, commit the files that have been added to the staging area. Including a message in the git commit command is mandatory.

For more details, refer to the video Add and commit from Module 3, Lesson 1 in the Version Control course.

GitHub

Usually, you store Git repositories on GitHub. It has source control management (SCM) and some other features such as project management, support ticket management and bug tracking. Developers use GitHub to share their repositories, access other developers' repositories and store remote copies of repositories to serve as backups.

You can sign up for GitHub by following this link . You can then create a new repository.

To learn more about GitHub and setting up your account, refer to the reading Create your GitHub account from Module 3, Lesson 1 of the Version Control course.

Now that you've set up your account, go back to the Git terminal and push the local repository to the GitHub repository.

Conclusion

In this reading, you revisited version control and Git. You also learned how to create and push a local repository on GitHub.